package com.estagio.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "modelo")
public class Modelo {

	@Id
	@SequenceGenerator(name="modelo_id", sequenceName="modelo_id_seq",allocationSize=1,initialValue = 1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="modelo_id" )
	private Integer idModelo;
	
	@JoinColumn(name="idMarca")
	@ManyToOne
	private Marca marca;
	@Column(length=40)
	private String descricao;

	

	public Integer getIdModelo() {
		return idModelo;
	}

	public void setIdModelo(Integer idModelo) {
		this.idModelo = idModelo;
	}

	public String getDescricao() {
		return descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public Marca getMarca() {
		return marca;
	}

	public void setMarca(Marca marca) {
		this.marca = marca;
	}

}